-
-
Notifications
You must be signed in to change notification settings - Fork 49
Update to Swift 6.1 #3761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to Swift 6.1 #3761
Conversation
26bbfb2
to
f9fcb2c
Compare
$(swift build --show-bin-path -c release)/Run serve --port 8080 --hostname 0.0.0.0 & | ||
sleep 10 | ||
echo Probing api/version... | ||
bash -c '[ "$(curl -sL -w "%{http_code}" -o /dev/null http://127.0.0.1:8080/api/version)" == "200" ] || (echo Connection failed ; exit 1)' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a new smoke test where we launch the release build and probe it via curl.
I've tested this with a debug build (which is not broken) here: https://github.com/SwiftPackageIndex/SwiftPackageIndex-Server/actions/runs/14441053515/job/40491081845?pr=3761
I'm thinking we should put the package collection sources we extract from SwiftPM into its own package. That'll make it easier to see what the diffs are and perhaps add back signing later without dealing with all of the server project. |
30bc31a
to
831d5b3
Compare
Package.swift
Outdated
@@ -95,7 +95,7 @@ let package = Package( | |||
.product(name: "DependenciesTestSupport", package: "swift-dependencies"), | |||
.product(name: "SnapshotTesting", package: "swift-snapshot-testing"), | |||
.product(name: "InlineSnapshotTesting", package: "swift-snapshot-testing"), | |||
.product(name: "XCTVapor", package: "vapor"), | |||
.product(name: "VaporTesting", package: "vapor"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's yet another wrinkle. Dropping SwiftPM as a dependency highlighted that we were lagging behind on Vapor updates. Running the tests with the latest version raised many warnings of the kind:
Test show_owner() started.
🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻
XCTVapor function triggered in a swift-testing context.
This will result in test failures not being reported.
Use 'app.testable()' in XCTest tests, and 'app.testing()' in swift-testing ones.
Use `XCTVaporContext.$emitWarningIfCurrentTestInfoIsAvailable.withValue(false) { /* Execute your tests here */ }` to avoid this warning.
Location: /Users/sas/Projects/SPI/spi-server/Tests/AppTests/AuthorControllerTests.swift:86
🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺
2025-04-16T12:49:42+0200 info codes.vapor.application : component=server request-id=A3EE65CD-E41D-4147-8965-48D604664B2F [Vapor] GET /owner
Test show_owner() passed after 0.526 seconds.
Test updates were needed to address these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a big changeset. I might defer this to a separate PR once I've fixed all tests and ensure they are passing in CI.
There's currently one test failing, search_unauthenticated
.
Test search_unauthenticated() started.
2025-04-16T13:07:55+0200 info codes.vapor.application : request-id=10018F96-8B59-4A39-8293-6CAA49A5EE60 [Vapor] GET /api/search
Test search_unauthenticated() recorded an issue at ApiTests.swift:125:21: Expectation failed: (res.status → 404 Not Found) == (.unauthorized → 401 Unauthorized)
// validation
Test search_unauthenticated() failed after 0.023 seconds with 1 issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are passing, I'm moving this to a follow-up PR.
dd0a59e
to
71f8e53
Compare
This reverts commit bd6b110.
62a56be
to
75679ea
Compare
This updates to the Swift 6.1 base image spi-base:1.2.0.
It also drops SwiftPM as a dependency in favour of a new package PackageCollections, in order to work around the issues #3755 and #3759.
This replacement package does not yet support package collections signing. This means we will not be signing the package collections we host until it does.
Fixes #3755 and #3759.